package v3.originator;

import originator.CopierOriginator;
import v3.caretaker.GestionDefaire;
import v3.memento.CopierMementoV3;
import v3.memento.MementoV3;

public class CopierOriginatorV3 implements OriginatorV3 {

	public CopierOriginatorV3(CopierOriginator _copier, GestionDefaire _gestion) {
		super();
		this._copier = _copier;
		this._gestion = _gestion;
	}
	@Override
	public void execute() {
		MementoV3 m =new CopierMementoV3(this);
		_gestion.sauvegarder(m);
		_copier.execute();
	}
    
	private CopierOriginator _copier;
	private GestionDefaire _gestion;
	@Override
	public void setMemento(MementoV3 m) {
		((CopierOriginatorV3) m.getCommand()).execute();		
	}

}
